import { createStore, applyMiddleware, combineReducers } from "redux";
import { ThunkMiddleware } from "redux-thunk";
import HomeReducer from "./home/homeReducer";
import logger from "redux-logger";
import thunk from "redux-thunk";

const reducer = combineReducers({
  home: HomeReducer,
});

export type RootState = ReturnType<typeof reducer>;

const store = createStore(
  reducer,
  applyMiddleware(logger, thunk as ThunkMiddleware<RootState, any>)
);

export default store;
